<template>
	<view>
		<u-card padding="16">
			<view class="" slot="head">
				<view class="wrap">
					<u-row>
						<u-col span="10">
							<view class="title">
								<span>作业内容：</span><span>{{taskInfo.name}}</span>
							</view>
						</u-col>
					</u-row>
				</view>
			</view>
			<view class="" slot="body">
				<view class="wrap">
					<u-row>
						<u-col span="6">
							<view class="u-line-1 weikaishi" v-if="taskInfo.status == '未开始'">
								<span>状态：</span><span>{{taskInfo.status}}</span>
							</view>
							<view class="u-line-1 jinxingzhong" v-else-if="taskInfo.status == '作业中'">
								<span>状态：</span><span>{{taskInfo.status}}</span>
							</view>
							<view class="u-line-1 yizuofei" v-else-if="taskInfo.status == '作废'">
								<span>状态：</span><span>{{taskInfo.status}}</span>
							</view>
							<view class="u-line-1 yiwancheng" v-else>
								<span>状态：</span><span>{{taskInfo.status}}</span>
							</view>
						</u-col>
						<u-col span="6" >
							<view class="u-line-1">
								<span>作业日期：</span><span>{{taskInfo.v1}}</span>
							</view>
						</u-col>
						
					</u-row>
					<u-row >
						<u-col span="6">
							<view class="u-line-1 u-m-t-10">
								<span>单号：</span><span>{{taskInfo.orderNumber}}</span>
							</view>
						</u-col>
						<u-col span="6" >
							<view class="u-line-1 u-m-t-10">
								<span>客户单号：</span><span>{{taskInfo.customerNumber}}</span>
							</view>
						</u-col>
						
					</u-row>
					<u-row >
						<u-col span="6" >
							<view class="u-line-1 u-m-t-10">
								<span>类型：</span><span>{{taskInfo.taskWork}}</span>
							</view>
						</u-col>
						<u-col span="6">
							<view class="u-line-1 u-m-t-10">
								<span>类别：</span><span>{{taskInfo.v8}}</span>
							</view>
						</u-col>
					</u-row>
					<u-row >
						<u-col span="6">
							<view class="u-line-1 u-m-t-10">
								<span>车型：</span><span>{{taskInfo.carModel}}</span>
							</view>
						</u-col>
						<u-col span="6">
							<view class="u-line-1 u-m-t-10">
								<span>累计人数：</span><span>{{taskInfo.peoples}}</span>
							</view>
						</u-col>
					</u-row>
					<u-row v-if="taskInfo.taskWork == '跟车'">
						<u-col span="6">
							<view class="u-line-1 u-m-t-10">
								<span>门店数：</span><span>{{taskInfo.v9}}</span>
							</view>
						</u-col>
					</u-row>
					<u-row >
						<u-col span="6">
							<view class="u-line-1 u-m-t-10">
								<span>核算方式：</span><span>{{taskInfo.settlementMode}}</span>
							</view>
						</u-col>
						<u-col span="6" v-if="taskInfo.settlementMode == '体积'">
							<view class="u-line-1 u-m-t-10">
								<span>体积：</span><span>{{taskInfo.volume}}</span>
							</view>
						</u-col>
						<u-col span="6" v-if="taskInfo.settlementMode == '数量'">
							<view class="u-line-1 u-m-t-10">
								<span>数量：</span><span>{{taskInfo.nums}}</span>
							</view>
						</u-col>
						<u-col span="6" v-if="taskInfo.settlementMode == '重量'">
							<view class="u-line-1 u-m-t-10">
								<span>重量(吨)：</span><span>{{taskInfo.weights}}</span>
							</view>
						</u-col>
					</u-row>
					<u-row >
						<u-col span="6">
							<view class="u-line-1 u-m-t-10">
								<span>时效：</span><span>{{taskInfo.prescription}}</span>
							</view>
						</u-col>
						<u-col span="6" >
							<view class="u-line-1 u-m-t-10">
								<span>累计工时：</span><span>{{taskInfo.hours}}</span>
							</view>
						</u-col>
					</u-row>
					<u-row >
						<u-col span="6">
							<view class="u-line-1 u-m-t-10">
								<span>开始时间：</span><span v-if="taskInfo.createTimes">{{taskInfo.createTimes.substring(5, 16)}}</span>
							</view>
						</u-col>
						<u-col span="6">
							<view class="u-line-1 u-m-t-10">
								<span>结束时间：</span><span v-if="taskInfo.endTime">{{taskInfo.endTime.substring(5, 16)}}</span>
							</view>
						</u-col>
					</u-row>
				</view>
			</view>
		</u-card>
		<view style="text-align: ;">
			<image style="width: 110rpx;height: 110rpx;margin-left: 40rpx;" src="https://z3.ax1x.com/2021/07/20/WNk40I.png" mode=""></image>
			<span style="font-size: 32rpx;font-weight: 600;color: #606266;">排行名次</span>
		</view>
		<u-card padding="16" v-for="item in dataList" :key="item.id">
			<view class="" slot="head">
				<view class="wrap">
					<u-row>
						<u-col span="6">
							<view class="u-line-1 u-m-t-10" style="font-size: 30rpx;font-weight: 600;">
								<span>作业人员：</span><span>{{item.userName}}</span>
							</view>
						</u-col>
						<u-col span="6">
							<view class="u-line-1 u-m-t-10" style="font-size: 30rpx;font-weight: 600;">
								<image v-if="item.v1 == 1" style="width: 55rpx;height: 55rpx;" src="https://z3.ax1x.com/2021/07/20/WNkb9S.png" mode=""></image>
								<image v-if="item.v1 == 2" style="width: 45rpx;height: 45rpx;" src="https://z3.ax1x.com/2021/07/20/WNkvBn.png" mode=""></image>
								<image v-if="item.v1 == 3" style="width: 40rpx;height: 40rpx;" src="https://z3.ax1x.com/2021/07/20/WNAFc4.png" mode=""></image>
								<span>第{{item.v1}}名</span>
							</view>
						</u-col>
					</u-row>
				</view>
			</view>
			<view class="" slot="body">
				<view class="wrap">
					<u-row >
						<u-col span="6" v-if="item.settlementMode == '体积'">
							<view class="u-line-1 u-m-t-10">
								<span>体积：</span><span>{{item.volume}}</span>
							</view>
						</u-col>
						<u-col span="6" v-if="item.settlementMode == '数量'">
							<view class="u-line-1 u-m-t-10">
								<span>数量：</span><span>{{item.nums}}</span>
							</view>
						</u-col>
						<u-col span="6" v-if="item.settlementMode == '重量'">
							<view class="u-line-1 u-m-t-10">
								<span>重量(吨)：</span><span>{{item.weights}}</span>
							</view>
						</u-col>
						<u-col span="6">
							<view class="u-line-1 u-m-t-10">
								<span>工时：</span><span>{{item.hours}}</span>
							</view>
						</u-col>
					</u-row>
				</view>
			</view>
		</u-card>
	</view>
</template>
<script>
	export default {
		data() {
			return {
				dataList: [],
				taskInfo: {},
			}
		},
		onLoad(open) {
			this.$http.post('/rest/task/getById',{
			},{
				params: {id:open.taskid},
				header: {
					'Authorization' :uni.getStorageSync('token'),
				}
			}).then(res => {
				this.taskInfo = res.data.data
			})
			this.$http.post('/rest/taskDetailed/listSum',{
			},{
				params: {taskId:open.taskid},
				header: {
					'Authorization' :uni.getStorageSync('token'),
				}
			}).then(res => {
				let arr = []
				let no = 1
				for(let item1 of res.data.data) {
					item1.v1 = no
					arr.push(item1)
					no++
				}
				this.dataList = arr
			})
		},
		methods: {
		}
	}
</script>
